﻿// Version:1
// Author:Sanket Naik
// Date:July-21-2010 
// Comments:
// 
// 
// 


using System;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using ManagedServices.DataTransferObjects;


namespace ManagedServices.Persistence
{
    /// <summary>
    /// The Data Context for the Msf_MessageBox database
    /// </summary>
    [global::System.Data.Linq.Mapping.DatabaseAttribute(Name = "Msf_MessageBox")]
    public partial class MessageBoxDataContext : DataContext
    {

        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

        #region Extensibility Method Definitions
        partial void OnCreated();
        partial void InsertEventLog(EventLog instance);
        partial void UpdateEventLog(EventLog instance);
        partial void DeleteEventLog(EventLog instance);
        partial void InsertMessageStore(MessageStore instance);
        partial void UpdateMessageStore(MessageStore instance);
        partial void DeleteMessageStore(MessageStore instance);
        #endregion

        
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="connection">connection string</param>
        public MessageBoxDataContext(string connection) :
            base(connection, mappingSource)
        {
            OnCreated();
        }


        /// <summary>
        /// Gets the Event Logs from the data base
        /// </summary>
        public System.Data.Linq.Table<EventLog> EventLogs
        {
            get
            {
                return this.GetTable<EventLog>();
            }
        }

        /// <summary>
        /// Gets the Messages in the Message Store Table
        /// </summary>
        public System.Data.Linq.Table<MessageStore> Messages
        {
            get
            {
                return this.GetTable<MessageStore>();
            }
        }

        /// <summary>
        /// Gets the messages queued to the Queued Items
        /// </summary>
        public System.Data.Linq.Table<MessageQueue> MessageQueuedItems
        {
            get 
            {
                
                return this.GetTable<MessageQueue>();
            }
        }
    }
}
